<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

{:token()}
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">订单号:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-order_sn" data-rule="required" class="form-control" name="row[order_sn]" type="text" >
        </div>
    </div>
    <div class="form-group">
        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">客户姓名:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-kehu_truename" data-rule="required" class="form-control" name="row[kehu_truename]" type="text" >
        </div>
    </div>

    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">手机号:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-kehu_mobile" data-rule="required" class="form-control" name="row[kehu_mobile]" type="text">
        </div>
    </div>


    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">订单时间:</label>
        <div class="col-xs-12 col-sm-4">
            <input type="datetime" name="row[order_time]" data-rule="required"  class="form-control datetimepicker" id="datetime"  />
        </div>
    </div>

    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">订单产品:</label>
        <div class="col-xs-12 col-sm-8">
               {foreach name="goods" item="vo"}
			   <input type="checkbox" name="goods[]" class="goods_id" value="{$vo.id}" />{$vo.title}
                {/foreach}	
        </div>
    </div>
	

    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-4">
<table class="table table-hover table-bordered" style="width:440px; margin:auto;">
  <tr>
    <th>产品名称</th>
    <th>规格</th>
    <th>价格</th>
    <th>数量</th>
  </tr>
  {foreach name="goods" item="vo"}
  <tr id="goods_{$vo.id}" style="display:none;">
    <td>{$vo.title}</td>
    <td>
		<select name="guige_{$vo.id}" class="form-control">
        {foreach name="guige" item="gg"}
                <option value="{$gg.id}"  >{$gg.title}</option>
		{/foreach}	             
		</select>	
	
	</td>
    <td>	
		<input type="text" name="price_{$vo.id}" class="form-control orders_input" />
	</td>
    <td><input type="text" name="num_{$vo.id}" class="form-control orders_input" /></td>
  </tr>
  {/foreach}	
</table>
					
        </div>
    </div>
	
	

	


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<style type="text/css">
.orders_input{width:60px;}
td,th{text-align:center;}
</style>

<!-- 时间选择器样式表 -->
<link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.22.1/moment-with-locales.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
	<script>
		$("#datetime").datetimepicker({
			format: 'YYYY-MM-DD HH:mm:ss',
			locale: moment.locale('zh-CN'),
			//minDate: '2020/02/22'
		});
		$(".goods_id").click(function(){
			var ginfo='#goods_'+$(this).attr('value');
			if($(this).is(':checked')){
				$(ginfo).show();
			}else{
				$(ginfo).hide();
			}
		})
	</script>